import Vue from 'vue'
import VueRouter from 'vue-router'

import home_page from './components/Home.vue'
import shopping_page from './components/shopping.vue'
import shopping_cart_page from './components/shopping_cart.vue'
import user_page from './components/user.vue'
import become_a_merchant from './components/user_subassembly/personal_center_page/personal_subassembly/become_a_merchant.vue'
import merchandise_control from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control.vue'
import log_off_page from './components/user_subassembly/personal_center_page/personal_subassembly/log_off.vue'
import my_orders_page from './components/user_subassembly/personal_center_page/personal_subassembly/my_orders.vue'
import shipping_address_page from './components/user_subassembly/personal_center_page/personal_subassembly/shipping_address.vue'
import grounding_goods from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control_page/grounding_goods.vue'
import my_goods from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control_page/my_goods.vue'
import order_list from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control_page/order_list.vue'
import all_order_list from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control_page/all_order_list.vue'
import goods_info from './components/shopping_subassembly/goods_info.vue'
import add_address from './components/user_subassembly/personal_center_page/personal_subassembly/shipping_address/add_address.vue'
import address_info from './components/user_subassembly/personal_center_page/personal_subassembly/shipping_address/address_info.vue'
import my_goods_info from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control_page/my_goods_info.vue'
import pay_info from './components/shopping_subassembly/pay_info.vue'
import order_info from './components/user_subassembly/personal_center_page/personal_subassembly/my_orders/order_info.vue'
import processing_order from './components/user_subassembly/personal_center_page/personal_subassembly/merchandise_control_page/order_list_info.vue'

Vue.use(VueRouter)


const routes = [
  {
    path: '/',
    component: home_page
  },
  {
    path: '/home',
    component: home_page
  },
  {
    path: '/shopping',
    component: shopping_page
  },
  {
    path: '/goodsinfo/:id',
    component: goods_info,
    props:true,
    name:'goodsinfo'
  },
  {
    path: '/shopping_cart',
    component: shopping_cart_page
  },
  {
    path: '/user',
    component: user_page,
    children: [
      {
        path: '/user/become_a_merchant',
        component: become_a_merchant
      },
      {
        path: '/user/merchandise_control',
        component: merchandise_control,
        children: [
          {
            path: '/user/merchandise_control/grounding_goods',
            component: grounding_goods
          },
          {
            path: '/user/merchandise_control/my_goods',
            component: my_goods
          },
          {
            path: '/user/merchandise_control/order_list',
            component: order_list
          },
          {
            path: '/user/merchandise_control/all_order_list',
            component: all_order_list
          },
          {
            path: '/user/merchandise_control/my_goods_info/:id',
            component: my_goods_info,
            props:true,
            name:'my_goods_info'
          },
          {
            path: '/user/merchandise_control/order_list/processing_order/:id',
            component: processing_order,
            props:true,
            name:'processing_order'
          },
          
          
        ]
      },
      {
        path: '/user/log_off',
        component: log_off_page
      },
      {
        path: '/user/my_orders',
        component: my_orders_page
      },
      {
        path:'/user/shipping_address',
        component:shipping_address_page
      },
      {
        path:'/user/shipping_address/add_address',
        component:add_address
      },
      {
        path: '/user/shipping_address/address_info/:id',
        component: address_info,
        props:true,
        name:'address_info'
      },
      {
        path: '/goodsinfo/pay_info/:id',
        component: pay_info,
        props:true,
        name:'pay_info'
      },
      {
        path: '/user/my_orders/order_info/:id',
        component: order_info,
        props:true,
        name:'order_info'
      },
    ]
  },


]


const router = new VueRouter({
  routes,

})
export default router